#ifndef MOVEJOINTOPERATION_H
#define MOVEJOINTOPERATION_H

#include <QObject>
#include <QDebug>
#include "operation.h"
#include "description.h"
#include <QJsonObject>

class MoveJointOperation : public Operation
{
    Q_OBJECT
public:
    explicit MoveJointOperation(QObject *parent = nullptr);
    ~MoveJointOperation();

public:
    virtual void run() override;

private:
    QList<double>       m_dblJointAngles;
    double              m_dblVelocity;
    double              m_dblAcceleration;

public:
    QList<double>       GetJointAngles(){return m_dblJointAngles;}
    double              GetVelocity(){return m_dblVelocity;}
    double              GetAcceleration(){return m_dblAcceleration;}
    Description*        GetDescription(){return m_pDescription;}

private:
    Description*        m_pDescription;

public:
    void                SetMoveJoint(int index,double angle){
        m_dblJointAngles.replace(index,angle);
    }

public:
    virtual Operation* clone(Operation* pOperation) override;
    virtual void writeXML(QXmlStreamWriter& writer) override;
    virtual void readFromXML(QXmlStreamReader& reader) override;

    virtual QString getClassName() override;


    QList<double>& dblJointAngles();
    void setDblJointAngles(const QList<double> &newDblJointAngles);
};

#endif // MOVEJOINTOPERATION_H
